import { customRequest } from "../request/custom";
import { get,del } from "../request/request";

/**
 * 获取聊天信息列表
 * @param id 
 * @param callback 
 */
export const fetchChat = async (id:string,callback?: () => void | boolean) => {
  return customRequest(() => get(`/api/chat/${id}`), callback);
};
/**
 * 获取联系人列表
 * @param callback 
 */
export const fetchChatList = async (
  callback?: () => void | boolean
) => {
  return customRequest(() => get(`/api/chat/mycontact/list`), callback);
};

/**
 * 移除联系人
 * @param id 
 * @param callback 
 */
export const fetchDelChatList = async (
  id:string,
  callback?: () => void | boolean
) => {
  return customRequest(() => del(`/api/chat/contact/${id}`), callback);
};